<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>

<div>
<p>圆的半径：<input id="r" type="text"></p>
<p>圆的周长：<input id="zc" type="text"></p>
<p>圆的面积：<input id="mj" type="text"></p>
    <script>
    var r=prompt("请输入圆的半径");
    r=parseFloat(r)&&Number(r);
    if(!isNaN(r)){
        var zc=Math.PI*r*2;
        var mj=Math.PI*r*r;
        document.getElementById('r').value=r;
        document.getElementById('zc').value=zc.toFixed(2);
        document.getElementById('mj').value=mj.toFixed(2);
    }else{
        alert("输入数字.")
    }
</script>
</div>
<a href="../第二章.html">返回第二章</a>
</body>
</html>